import java.util.Arrays;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-05-07
 * Time: 21:24
 */
public class Test {
    public static void main(String[] args) {
        int[][] array2 = new int[][]{{1,2,3},{4,5,6}};

    }
    public static void main1(String[] args) {
//        二维数组定义及初始化
        int[][] array1 = {{1,2,3},{1,2,3}};
        int[][] array2 = new int[][]{{1,2,3},{4,5,6}};

        int[][] array3 = new int[2][3];

        System.out.println(array2[0]);
        System.out.println(array2[1]);

//        遍历数组元素的方法
//        1.
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(array2[i][j] + " ");
            }
            System.out.println();
        }
//        2.
        for (int[] tmp:array2) {
            for (int x:tmp) {
                System.out.print(x + " ");
            }
            System.out.println();
        }
//        3.
        String ret = Arrays.deepToString(array2);
        System.out.println(ret);

//        4.
        for (int i = 0; i < array2.length; i++) {
            for (int j = 0; j < array2[i].length; j++) {
                System.out.print(array2[i][j] + " ");
            }
            System.out.println();
        }
//        5.
        for (int i = 0; i < array2.length; i++) {
            System.out.println(Arrays.toString(array2[i]));
        }
    }
}
